home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / HFSVolumes.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  20.5 KB  |  422 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        HFSVolumes.a
  3. ;
  4. ;    Contains:    On-disk data structures for HFS and HFS Plus volumes.
  5. ;
  6. ;    Version:    Technology:    
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1984-1998 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__HFSVOLUMES__') = 'UNDEFINED' THEN
  19. __HFSVOLUMES__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  25.     include 'Files.a'
  26.     ENDIF
  27.     IF &TYPE('__FINDER__') = 'UNDEFINED' THEN
  28.     include 'Finder.a'
  29.     ENDIF
  30.  
  31.  
  32. ;  Signatures used to differentiate between HFS and HFS Plus volumes 
  33.  
  34. kHFSSigWord                        EQU        $4244                ; 'BD' in ASCII 
  35. kHFSPlusSigWord                    EQU        $482B                ; 'H+' in ASCII 
  36. kHFSPlusVersion                    EQU        $0004                ; will change as format changes (version 4 shipped with Mac OS 8.1) 
  37. kHFSPlusMountVersion            EQU        '8.10'                ; will change as implementations change ('8.10' in Mac OS 8.1) 
  38.  
  39. ;  CatalogNodeID is used to track catalog objects 
  40. ; typedef UInt32                         HFSCatalogNodeID
  41.  
  42. ;  Unicode strings are used for file and folder names (HFS Plus only) 
  43. HFSUniStr255            RECORD 0
  44. length                     ds.w    1                ; offset: $0 (0)        ;  number of unicode characters 
  45. unicode                     ds.w    255                ; offset: $2 (2)        ;  unicode characters 
  46. sizeof                     EQU *                    ; size:   $200 (512)
  47.                         ENDR
  48. ; typedef const struct HFSUniStr255 *    ConstHFSUniStr255Param
  49.  
  50.  
  51. kHFSMaxVolumeNameChars            EQU        27
  52. kHFSMaxFileNameChars            EQU        31
  53. kHFSPlusMaxFileNameChars        EQU        255
  54.  
  55. ;  Extent overflow file data structures 
  56. ;  HFS Extent key 
  57. HFSExtentKey            RECORD 0
  58. keyLength                 ds.b    1                ; offset: $0 (0)        ;  length of key, excluding this field 
  59. forkType                 ds.b    1                ; offset: $1 (1)        ;  0 = data fork, FF = resource fork 
  60. fileID                     ds.l    1                ; offset: $2 (2)        ;  file ID 
  61. startBlock                 ds.w    1                ; offset: $6 (6)        ;  first file allocation block number in this extent 
  62. sizeof                     EQU *                    ; size:   $8 (8)
  63.                         ENDR
  64. ;  HFS Plus Extent key 
  65. HFSPlusExtentKey        RECORD 0
  66. keyLength                 ds.w    1                ; offset: $0 (0)        ;  length of key, excluding this field 
  67. forkType                 ds.b    1                ; offset: $2 (2)        ;  0 = data fork, FF = resource fork 
  68. pad                         ds.b    1                ; offset: $3 (3)        ;  make the other fields align on 32-bit boundary 
  69. fileID                     ds.l    1                ; offset: $4 (4)        ;  file ID 
  70. startBlock                 ds.l    1                ; offset: $8 (8)        ;  first file allocation block number in this extent 
  71. sizeof                     EQU *                    ; size:   $C (12)
  72.                         ENDR
  73. ;  Number of extent descriptors per extent record 
  74.  
  75. kHFSExtentDensity                EQU        3
  76. kHFSPlusExtentDensity            EQU        8
  77. ;  HFS extent descriptor 
  78. HFSExtentDescriptor        RECORD 0
  79. startBlock                 ds.w    1                ; offset: $0 (0)        ;  first allocation block 
  80. blockCount                 ds.w    1                ; offset: $2 (2)        ;  number of allocation blocks 
  81. sizeof                     EQU *                    ; size:   $4 (4)
  82.                         ENDR
  83. ;  HFS Plus extent descriptor 
  84. HFSPlusExtentDescriptor    RECORD 0
  85. startBlock                 ds.l    1                ; offset: $0 (0)        ;  first allocation block 
  86. blockCount                 ds.l    1                ; offset: $4 (4)        ;  number of allocation blocks 
  87. sizeof                     EQU *                    ; size:   $8 (8)
  88.                         ENDR
  89. ;  HFS extent record 
  90. HFSExtentRecord            RECORD 0
  91. elements                 ds.b    3 * HFSExtentDescriptor.sizeof
  92. sizeof                     EQU *                    ; size:   $C (12)
  93.                         ENDR
  94.  
  95.  
  96. ;  HFS Plus extent record 
  97. HFSPlusExtentRecord        RECORD 0
  98. elements                 ds.b    8 * HFSPlusExtentDescriptor.sizeof
  99. sizeof                     EQU *                    ; size:   $40 (64)
  100.                         ENDR
  101.  
  102.  
  103.  
  104. ;  Fork data info (HFS Plus only) - 80 bytes 
  105. HFSPlusForkData            RECORD 0
  106. logicalSize                 ds        UInt64            ; offset: $0 (0)        ;  fork's logical size in bytes 
  107. clumpSize                 ds.l    1                ; offset: $8 (8)        ;  fork's clump size in bytes 
  108. totalBlocks                 ds.l    1                ; offset: $C (12)        ;  total blocks used by this fork 
  109. extents                     ds        HFSPlusExtentRecord ; offset: $10 (16) ;  initial set of extents 
  110. sizeof                     EQU *                    ; size:   $50 (80)
  111.                         ENDR
  112. ;  Permissions info (HFS Plus only) - 16 bytes 
  113. HFSPlusPermissions        RECORD 0
  114. ownerID                     ds.l    1                ; offset: $0 (0)        ;  user or group ID of file/folder owner 
  115. groupID                     ds.l    1                ; offset: $4 (4)        ;  additional user of group ID 
  116. permissions                 ds.l    1                ; offset: $8 (8)        ;  permissions (bytes: unused, owner, group, everyone) 
  117. specialDevice             ds.l    1                ; offset: $C (12)        ;  UNIX: device for character or block special file 
  118. sizeof                     EQU *                    ; size:   $10 (16)
  119.                         ENDR
  120. ;  Catalog file data structures 
  121.  
  122. kHFSRootParentID                EQU        1                    ; Parent ID of the root folder 
  123. kHFSRootFolderID                EQU        2                    ; Folder ID of the root folder 
  124. kHFSExtentsFileID                EQU        3                    ; File ID of the extents file 
  125. kHFSCatalogFileID                EQU        4                    ; File ID of the catalog file 
  126. kHFSBadBlockFileID                EQU        5                    ; File ID of the bad allocation block file 
  127. kHFSAllocationFileID            EQU        6                    ; File ID of the allocation file (HFS Plus only) 
  128. kHFSStartupFileID                EQU        7                    ; File ID of the startup file (HFS Plus only) 
  129. kHFSAttributesFileID            EQU        8                    ; File ID of the attribute file (HFS Plus only) 
  130. kHFSBogusExtentFileID            EQU        15                    ; Used for exchanging extents in extents file 
  131. kHFSFirstUserCatalogNodeID        EQU        16
  132.  
  133. ;  HFS catalog key 
  134. HFSCatalogKey            RECORD 0
  135. keyLength                 ds.b    1                ; offset: $0 (0)        ;  key length (in bytes) 
  136. reserved                 ds.b    1                ; offset: $1 (1)        ;  reserved (set to zero) 
  137. parentID                 ds.l    1                ; offset: $2 (2)        ;  parent folder ID 
  138. nodeName                 ds        Str31            ; offset: $6 (6)        ;  catalog node name 
  139. sizeof                     EQU *                    ; size:   $26 (38)
  140.                         ENDR
  141. ;  HFS Plus catalog key 
  142. HFSPlusCatalogKey        RECORD 0
  143. keyLength                 ds.w    1                ; offset: $0 (0)        ;  key length (in bytes) 
  144. parentID                 ds.l    1                ; offset: $2 (2)        ;  parent folder ID 
  145. nodeName                 ds        HFSUniStr255    ; offset: $6 (6)        ;  catalog node name 
  146. sizeof                     EQU *                    ; size:   $206 (518)
  147.                         ENDR
  148.  
  149. ;  Catalog record types 
  150.  
  151.                                                             ; HFS Catalog Records 
  152. kHFSFolderRecord                EQU        $0100                ; Folder record 
  153. kHFSFileRecord                    EQU        $0200                ; File record 
  154. kHFSFolderThreadRecord            EQU        $0300                ; Folder thread record 
  155. kHFSFileThreadRecord            EQU        $0400                ; File thread record 
  156.                                                             ; HFS Plus Catalog Records 
  157. kHFSPlusFolderRecord            EQU        1                    ; Folder record 
  158. kHFSPlusFileRecord                EQU        2                    ; File record 
  159. kHFSPlusFolderThreadRecord        EQU        3                    ; Folder thread record 
  160. kHFSPlusFileThreadRecord        EQU        4                    ; File thread record 
  161.  
  162. ;  Catalog file record flags 
  163.  
  164. kHFSFileLockedBit                EQU        $0000                ; file is locked and cannot be written to 
  165. kHFSFileLockedMask                EQU        $0001
  166. kHFSThreadExistsBit                EQU        $0001                ; a file thread record exists for this file 
  167. kHFSThreadExistsMask            EQU        $0002
  168.  
  169. ;  HFS catalog folder record - 70 bytes 
  170. HFSCatalogFolder        RECORD 0
  171. recordType                 ds.w    1                ; offset: $0 (0)        ;  record type 
  172. flags                     ds.w    1                ; offset: $2 (2)        ;  folder flags 
  173. valence                     ds.w    1                ; offset: $4 (4)        ;  folder valence 
  174. folderID                 ds.l    1                ; offset: $6 (6)        ;  folder ID 
  175. createDate                 ds.l    1                ; offset: $A (10)        ;  date and time of creation 
  176. modifyDate                 ds.l    1                ; offset: $E (14)        ;  date and time of last modification 
  177. backupDate                 ds.l    1                ; offset: $12 (18)        ;  date and time of last backup 
  178. userInfo                 ds        DInfo            ; offset: $16 (22)        ;  Finder information 
  179. finderInfo                 ds        DXInfo            ; offset: $26 (38)        ;  additional Finder information 
  180. reserved                 ds.l    4                ; offset: $36 (54)        ;  reserved - set to zero 
  181. sizeof                     EQU *                    ; size:   $46 (70)
  182.                         ENDR
  183. ;  HFS Plus catalog folder record - 88 bytes 
  184. HFSPlusCatalogFolder    RECORD 0
  185. recordType                 ds.w    1                ; offset: $0 (0)        ;  record type = HFS Plus folder record 
  186. flags                     ds.w    1                ; offset: $2 (2)        ;  file flags 
  187. valence                     ds.l    1                ; offset: $4 (4)        ;  folder's valence (limited to 2^16 in Mac OS) 
  188. folderID                 ds.l    1                ; offset: $8 (8)        ;  folder ID 
  189. createDate                 ds.l    1                ; offset: $C (12)        ;  date and time of creation 
  190. contentModDate             ds.l    1                ; offset: $10 (16)        ;  date and time of last content modification 
  191. attributeModDate         ds.l    1                ; offset: $14 (20)        ;  date and time of last attribute modification 
  192. accessDate                 ds.l    1                ; offset: $18 (24)        ;  date and time of last access (Rhapsody only) 
  193. backupDate                 ds.l    1                ; offset: $1C (28)        ;  date and time of last backup 
  194. permissions                 ds        HFSPlusPermissions ; offset: $20 (32)    ;  permissions (for Rhapsody) 
  195. userInfo                 ds        DInfo            ; offset: $30 (48)        ;  Finder information 
  196. finderInfo                 ds        DXInfo            ; offset: $40 (64)        ;  additional Finder information 
  197. textEncoding             ds.l    1                ; offset: $50 (80)        ;  hint for name conversions 
  198. reserved                 ds.l    1                ; offset: $54 (84)        ;  reserved - set to zero 
  199. sizeof                     EQU *                    ; size:   $58 (88)
  200.                         ENDR
  201. ;  HFS catalog file record - 102 bytes 
  202. HFSCatalogFile            RECORD 0
  203. recordType                 ds.w    1                ; offset: $0 (0)        ;  record type 
  204. flags                     ds.b    1                ; offset: $2 (2)        ;  file flags 
  205. fileType                 ds.b    1                ; offset: $3 (3)        ;  file type (unused ?) 
  206. userInfo                 ds        FInfo            ; offset: $4 (4)        ;  Finder information 
  207. fileID                     ds.l    1                ; offset: $14 (20)        ;  file ID 
  208. dataStartBlock             ds.w    1                ; offset: $18 (24)        ;  not used - set to zero 
  209. dataLogicalSize             ds.l    1                ; offset: $1A (26)        ;  logical EOF of data fork 
  210. dataPhysicalSize         ds.l    1                ; offset: $1E (30)        ;  physical EOF of data fork 
  211. rsrcStartBlock             ds.w    1                ; offset: $22 (34)        ;  not used - set to zero 
  212. rsrcLogicalSize             ds.l    1                ; offset: $24 (36)        ;  logical EOF of resource fork 
  213. rsrcPhysicalSize         ds.l    1                ; offset: $28 (40)        ;  physical EOF of resource fork 
  214. createDate                 ds.l    1                ; offset: $2C (44)        ;  date and time of creation 
  215. modifyDate                 ds.l    1                ; offset: $30 (48)        ;  date and time of last modification 
  216. backupDate                 ds.l    1                ; offset: $34 (52)        ;  date and time of last backup 
  217. finderInfo                 ds        FXInfo            ; offset: $38 (56)        ;  additional Finder information 
  218. clumpSize                 ds.w    1                ; offset: $48 (72)        ;  file clump size (not used) 
  219. dataExtents                 ds        HFSExtentRecord ; offset: $4A (74)        ;  first data fork extent record 
  220. rsrcExtents                 ds        HFSExtentRecord ; offset: $56 (86)        ;  first resource fork extent record 
  221. reserved                 ds.l    1                ; offset: $62 (98)        ;  reserved - set to zero 
  222. sizeof                     EQU *                    ; size:   $66 (102)
  223.                         ENDR
  224. ;  HFS Plus catalog file record - 248 bytes 
  225. HFSPlusCatalogFile        RECORD 0
  226. recordType                 ds.w    1                ; offset: $0 (0)        ;  record type = HFS Plus file record 
  227. flags                     ds.w    1                ; offset: $2 (2)        ;  file flags 
  228. reserved1                 ds.l    1                ; offset: $4 (4)        ;  reserved - set to zero 
  229. fileID                     ds.l    1                ; offset: $8 (8)        ;  file ID 
  230. createDate                 ds.l    1                ; offset: $C (12)        ;  date and time of creation 
  231. contentModDate             ds.l    1                ; offset: $10 (16)        ;  date and time of last content modification 
  232. attributeModDate         ds.l    1                ; offset: $14 (20)        ;  date and time of last attribute modification 
  233. accessDate                 ds.l    1                ; offset: $18 (24)        ;  date and time of last access (Rhapsody only) 
  234. backupDate                 ds.l    1                ; offset: $1C (28)        ;  date and time of last backup 
  235. permissions                 ds        HFSPlusPermissions ; offset: $20 (32)    ;  permissions (for Rhapsody) 
  236. userInfo                 ds        FInfo            ; offset: $30 (48)        ;  Finder information 
  237. finderInfo                 ds        FXInfo            ; offset: $40 (64)        ;  additional Finder information 
  238. textEncoding             ds.l    1                ; offset: $50 (80)        ;  hint for name conversions 
  239. reserved2                 ds.l    1                ; offset: $54 (84)        ;  reserved - set to zero 
  240. ;  start on double long (64 bit) boundry 
  241. dataFork                 ds        HFSPlusForkData ; offset: $58 (88)        ;  size and block data for data fork 
  242. resourceFork             ds        HFSPlusForkData ; offset: $A8 (168)        ;  size and block data for resource fork 
  243. sizeof                     EQU *                    ; size:   $F8 (248)
  244.                         ENDR
  245. ;  HFS catalog thread record - 46 bytes 
  246. HFSCatalogThread        RECORD 0
  247. recordType                 ds.w    1                ; offset: $0 (0)        ;  record type 
  248. reserved                 ds.l    2                ; offset: $2 (2)        ;  reserved - set to zero 
  249. parentID                 ds.l    1                ; offset: $A (10)        ;  parent ID for this catalog node 
  250. nodeName                 ds        Str31            ; offset: $E (14)        ;  name of this catalog node 
  251. sizeof                     EQU *                    ; size:   $2E (46)
  252.                         ENDR
  253. ;  HFS Plus catalog thread record -- 264 bytes 
  254. HFSPlusCatalogThread    RECORD 0
  255. recordType                 ds.w    1                ; offset: $0 (0)        ;  record type 
  256. reserved                 ds.w    1                ; offset: $2 (2)        ;  reserved - set to zero 
  257. parentID                 ds.l    1                ; offset: $4 (4)        ;  parent ID for this catalog node 
  258. nodeName                 ds        HFSUniStr255    ; offset: $8 (8)        ;  name of this catalog node (variable length) 
  259. sizeof                     EQU *                    ; size:   $208 (520)
  260.                         ENDR
  261.  
  262.  
  263. ;      These are the types of records in the attribute B-tree.  The values were chosen
  264. ;      so that they wouldn't conflict with the catalog record types.
  265.  
  266.  
  267.  
  268. kHFSPlusAttrInlineData            EQU        $10                    ; if size <  kAttrOverflowSize 
  269. kHFSPlusAttrForkData            EQU        $20                    ; if size >= kAttrOverflowSize 
  270. kHFSPlusAttrExtents                EQU        $30                    ; overflow extents for large attributes 
  271.  
  272.  
  273. ;      HFSPlusAttrInlineData
  274. ;      For small attributes, whose entire value is stored within this one
  275. ;      B-tree record.
  276. ;      There would not be any other records for this attribute.
  277.  
  278.  
  279. HFSPlusAttrInlineData    RECORD 0
  280. recordType                 ds.l    1                ; offset: $0 (0)        ;     = kHFSPlusAttrInlineData
  281. reserved                 ds.l    1                ; offset: $4 (4)
  282. logicalSize                 ds.l    1                ; offset: $8 (8)        ;     size in bytes of userData
  283. userData                 ds.b    2                ; offset: $C (12)        ;     variable length; space allocated is a multiple of 2 bytes
  284. sizeof                     EQU *                    ; size:   $E (14)
  285.                         ENDR
  286.  
  287. ;      HFSPlusAttrForkData
  288. ;      For larger attributes, whose value is stored in allocation blocks.
  289. ;      If the attribute has more than 8 extents, there will be additonal
  290. ;      records (of type HFSPlusAttrExtents) for this attribute.
  291.  
  292.  
  293. HFSPlusAttrForkData        RECORD 0
  294. recordType                 ds.l    1                ; offset: $0 (0)        ;     = kHFSPlusAttrForkData
  295. reserved                 ds.l    1                ; offset: $4 (4)
  296. theFork                     ds        HFSPlusForkData ; offset: $8 (8)        ;     size and first extents of value
  297. sizeof                     EQU *                    ; size:   $58 (88)
  298.                         ENDR
  299.  
  300. ;      HFSPlusAttrExtents
  301. ;      This record contains information about overflow extents for large,
  302. ;      fragmented attributes.
  303.  
  304.  
  305. HFSPlusAttrExtents        RECORD 0
  306. recordType                 ds.l    1                ; offset: $0 (0)        ;     = kHFSPlusAttrExtents
  307. reserved                 ds.l    1                ; offset: $4 (4)
  308. extents                     ds        HFSPlusExtentRecord ; offset: $8 (8)    ;     additional extents
  309. sizeof                     EQU *                    ; size:   $48 (72)
  310.                         ENDR
  311. ;     A generic Attribute Record
  312. HFSPlusAttrRecord        RECORD 0
  313. recordType                 ds.l    1                ; offset: $0 (0)
  314.                          ORG 0
  315. inlineData                 ds        HFSPlusAttrInlineData ; offset: $0 (0)
  316.                          ORG 0
  317. forkData                 ds        HFSPlusAttrForkData ; offset: $0 (0)
  318.                          ORG 0
  319. overflowExtents             ds        HFSPlusAttrExtents ; offset: $0 (0)
  320.                          ORG 88
  321. sizeof                     EQU *                    ; size:   $58 (88)
  322.                         ENDR
  323. ;  Key and node lengths 
  324.  
  325. kHFSPlusExtentKeyMaximumLength    EQU        10
  326. kHFSExtentKeyMaximumLength        EQU        7
  327. kHFSPlusCatalogKeyMaximumLength    EQU        516
  328. kHFSPlusCatalogKeyMinimumLength    EQU        6
  329. kHFSCatalogKeyMaximumLength        EQU        37
  330. kHFSCatalogKeyMinimumLength        EQU        6
  331. kHFSPlusCatalogMinNodeSize        EQU        4096
  332. kHFSPlusExtentMinNodeSize        EQU        512
  333. kHFSPlusAttrMinNodeSize            EQU        4096
  334.  
  335. ;  HFS and HFS Plus volume attribute bits 
  336.  
  337.                                                             ; Bits 0-6 are reserved (always cleared by MountVol call) 
  338. kHFSVolumeHardwareLockBit        EQU        7                    ; volume is locked by hardware 
  339. kHFSVolumeUnmountedBit            EQU        8                    ; volume was successfully unmounted 
  340. kHFSVolumeSparedBlocksBit        EQU        9                    ; volume has bad blocks spared 
  341. kHFSVolumeNoCacheRequiredBit    EQU        10                    ; don't cache volume blocks (i.e. RAM or ROM disk) 
  342. kHFSBootVolumeInconsistentBit    EQU        11                    ; boot volume is inconsistent (System 7.6 and later) 
  343.                                                             ; Bits 12-14 are reserved for future use 
  344. kHFSVolumeSoftwareLockBit        EQU        15                    ; volume is locked by software 
  345. kHFSVolumeHardwareLockMask        EQU        $80
  346. kHFSVolumeUnmountedMask            EQU        $0100
  347. kHFSVolumeSparedBlocksMask        EQU        $0200
  348. kHFSVolumeNoCacheRequiredMask    EQU        $0400
  349. kHFSBootVolumeInconsistentMask    EQU        $0800
  350. kHFSVolumeSoftwareLockMask        EQU        $8000
  351. kHFSMDBAttributesMask            EQU        $8380
  352.  
  353. ;  Master Directory Block (HFS only) - 162 bytes 
  354. ;  Stored at sector #2 (3rd sector) 
  355. HFSMasterDirectoryBlock    RECORD 0
  356. ;  These first fields are also used by MFS 
  357. drSigWord                 ds.w    1                ; offset: $0 (0)        ;  volume signature 
  358. drCrDate                 ds.l    1                ; offset: $2 (2)        ;  date and time of volume creation 
  359. drLsMod                     ds.l    1                ; offset: $6 (6)        ;  date and time of last modification 
  360. drAtrb                     ds.w    1                ; offset: $A (10)        ;  volume attributes 
  361. drNmFls                     ds.w    1                ; offset: $C (12)        ;  number of files in root folder 
  362. drVBMSt                     ds.w    1                ; offset: $E (14)        ;  first block of volume bitmap 
  363. drAllocPtr                 ds.w    1                ; offset: $10 (16)        ;  start of next allocation search 
  364. drNmAlBlks                 ds.w    1                ; offset: $12 (18)        ;  number of allocation blocks in volume 
  365. drAlBlkSiz                 ds.l    1                ; offset: $14 (20)        ;  size (in bytes) of allocation blocks 
  366. drClpSiz                 ds.l    1                ; offset: $18 (24)        ;  default clump size 
  367. drAlBlSt                 ds.w    1                ; offset: $1C (28)        ;  first allocation block in volume 
  368. drNxtCNID                 ds.l    1                ; offset: $1E (30)        ;  next unused catalog node ID 
  369. drFreeBks                 ds.w    1                ; offset: $22 (34)        ;  number of unused allocation blocks 
  370. drVN                     ds        Str27            ; offset: $24 (36)        ;  volume name 
  371. ;  Master Directory Block extensions for HFS 
  372. drVolBkUp                 ds.l    1                ; offset: $40 (64)        ;  date and time of last backup 
  373. drVSeqNum                 ds.w    1                ; offset: $44 (68)        ;  volume backup sequence number 
  374. drWrCnt                     ds.l    1                ; offset: $46 (70)        ;  volume write count 
  375. drXTClpSiz                 ds.l    1                ; offset: $4A (74)        ;  clump size for extents overflow file 
  376. drCTClpSiz                 ds.l    1                ; offset: $4E (78)        ;  clump size for catalog file 
  377. drNmRtDirs                 ds.w    1                ; offset: $52 (82)        ;  number of directories in root folder 
  378. drFilCnt                 ds.l    1                ; offset: $54 (84)        ;  number of files in volume 
  379. drDirCnt                 ds.l    1                ; offset: $58 (88)        ;  number of directories in volume 
  380. drFndrInfo                 ds.l    8                ; offset: $5C (92)        ;  information used by the Finder 
  381. drEmbedSigWord             ds.w    1                ; offset: $7C (124)        ;  embedded volume signature (formerly drVCSize) 
  382. drEmbedExtent             ds        HFSExtentDescriptor ; offset: $7E (126) ;  embedded volume location and size (formerly drVBMCSize and drCtlCSize) 
  383. drXTFlSize                 ds.l    1                ; offset: $82 (130)        ;  size of extents overflow file 
  384. drXTExtRec                 ds        HFSExtentRecord ; offset: $86 (134)        ;  extent record for extents overflow file 
  385. drCTFlSize                 ds.l    1                ; offset: $92 (146)        ;  size of catalog file 
  386. drCTExtRec                 ds        HFSExtentRecord ; offset: $96 (150)        ;  extent record for catalog file 
  387. sizeof                     EQU *                    ; size:   $A2 (162)
  388.                         ENDR
  389. ;  HFSPlusVolumeHeader (HFS Plus only) - 512 bytes 
  390. ;  Stored at sector #0 (1st sector) and last sector 
  391. HFSPlusVolumeHeader        RECORD 0
  392. signature                 ds.w    1                ; offset: $0 (0)        ;  volume signature == 'H+' 
  393. version                     ds.w    1                ; offset: $2 (2)        ;  current version is kHFSPlusVersion 
  394. attributes                 ds.l    1                ; offset: $4 (4)        ;  volume attributes 
  395. lastMountedVersion         ds.l    1                ; offset: $8 (8)        ;  implementation version which last mounted volume 
  396. reserved                 ds.l    1                ; offset: $C (12)        ;  reserved - set to zero 
  397. createDate                 ds.l    1                ; offset: $10 (16)        ;  date and time of volume creation 
  398. modifyDate                 ds.l    1                ; offset: $14 (20)        ;  date and time of last modification 
  399. backupDate                 ds.l    1                ; offset: $18 (24)        ;  date and time of last backup 
  400. checkedDate                 ds.l    1                ; offset: $1C (28)        ;  date and time of last disk check 
  401. fileCount                 ds.l    1                ; offset: $20 (32)        ;  number of files in volume 
  402. folderCount                 ds.l    1                ; offset: $24 (36)        ;  number of directories in volume 
  403. blockSize                 ds.l    1                ; offset: $28 (40)        ;  size (in bytes) of allocation blocks 
  404. totalBlocks                 ds.l    1                ; offset: $2C (44)        ;  number of allocation blocks in volume (includes this header and VBM
  405. freeBlocks                 ds.l    1                ; offset: $30 (48)        ;  number of unused allocation blocks 
  406. nextAllocation             ds.l    1                ; offset: $34 (52)        ;  start of next allocation search 
  407. rsrcClumpSize             ds.l    1                ; offset: $38 (56)        ;  default resource fork clump size 
  408. dataClumpSize             ds.l    1                ; offset: $3C (60)        ;  default data fork clump size 
  409. nextCatalogID             ds.l    1                ; offset: $40 (64)        ;  next unused catalog node ID 
  410. writeCount                 ds.l    1                ; offset: $44 (68)        ;  volume write count 
  411. encodingsBitmap             ds        UInt64            ; offset: $48 (72)        ;  which encodings have been use  on this volume 
  412. finderInfo                 ds.b    32                ; offset: $50 (80)        ;  information used by the Finder 
  413. allocationFile             ds        HFSPlusForkData ; offset: $70 (112)        ;  allocation bitmap file 
  414. extentsFile                 ds        HFSPlusForkData ; offset: $C0 (192)        ;  extents B-tree file 
  415. catalogFile                 ds        HFSPlusForkData ; offset: $110 (272)    ;  catalog B-tree file 
  416. attributesFile             ds        HFSPlusForkData ; offset: $160 (352)    ;  extended attributes B-tree file 
  417. startupFile                 ds        HFSPlusForkData ; offset: $1B0 (432)    ;  boot file 
  418. sizeof                     EQU *                    ; size:   $200 (512)
  419.                         ENDR
  420.     ENDIF ; __HFSVOLUMES__ 
  421.  
  422.